import time

import pandas as pd



js_code = r"""
// 纯 JavaScript MD5 实现（替代 crypto.createHash('md5')）
function md5(string) {
    function rotateLeft(lValue, iShiftBits) {
        return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
    }

    function addUnsigned(lX, lY) {
        var lX4, lY4, lX8, lY8, lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
        if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        if (lX4 | lY4) {
            if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
        } else return (lResult ^ lX8 ^ lY8);
    }

    function F(x, y, z) { return (x & y) | ((~x) & z); }
    function G(x, y, z) { return (x & z) | (y & (~z)); }
    function H(x, y, z) { return (x ^ y ^ z); }
    function I(x, y, z) { return (y ^ (x | (~z))); }

    function FF(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    }

    function GG(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    }

    function HH(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    }

    function II(a, b, c, d, x, s, ac) {
        a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
        return addUnsigned(rotateLeft(a, s), b);
    }

    function convertToWordArray(string) {
        var lWordCount;
        var lMessageLength = string.length;
        var lNumberOfWords_temp1 = lMessageLength + 8;
        var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
        var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
        var lWordArray = Array(lNumberOfWords - 1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while (lByteCount < lMessageLength) {
            lWordCount = (lByteCount - (lByteCount % 4)) / 4;
            lBytePosition = (lByteCount % 4) * 8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
            lByteCount++;
        }
        lWordCount = (lByteCount - (lByteCount % 4)) / 4;
        lBytePosition = (lByteCount % 4) * 8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
        lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
        lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
        return lWordArray;
    }

    function wordToHex(lValue) {
        var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount;
        for (lCount = 0; lCount <= 3; lCount++) {
            lByte = (lValue >>> (lCount * 8)) & 255;
            WordToHexValue_temp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
        }
        return WordToHexValue;
    }

    var x = Array();
    var k, AA, BB, CC, DD, a, b, c, d;
    var S11 = 7, S12 = 12, S13 = 17, S14 = 22;
    var S21 = 5, S22 = 9, S23 = 14, S24 = 20;
    var S31 = 4, S32 = 11, S33 = 16, S34 = 23;
    var S41 = 6, S42 = 10, S43 = 15, S44 = 21;

    string = utf8_encode(string);
    x = convertToWordArray(string);
    a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;

    for (k = 0; k < x.length; k += 16) {
        AA = a; BB = b; CC = c; DD = d;
        a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
        d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
        c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
        b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
        a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
        d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
        c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
        b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
        a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
        d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
        c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
        b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
        a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
        d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
        c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
        b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
        a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
        d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
        c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
        b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
        a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
        d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
        c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
        b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
        a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
        d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
        c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
        b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
        a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
        d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
        c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
        b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
        a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
        d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
        c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
        b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
        a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
        d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
        c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
        b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
        a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
        d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
        c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
        b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
        a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
        d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
        c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
        b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
        a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
        d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
        c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
        b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
        a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
        d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
        c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
        b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
        a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
        d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
        c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
        b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
        a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
        d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
        c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
        b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
        a = addUnsigned(a, AA);
        b = addUnsigned(b, BB);
        c = addUnsigned(c, CC);
        d = addUnsigned(d, DD);
    }

    var temp = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
    return temp.toLowerCase();
}

function utf8_encode(string) {
    string = string.replace(/\r\n/g, "\n");
    var utftext = "";

    for (var n = 0; n < string.length; n++) {
        var c = string.charCodeAt(n);

        if (c < 128) {
            utftext += String.fromCharCode(c);
        } else if ((c > 127) && (c < 2048)) {
            utftext += String.fromCharCode((c >> 6) | 192);
            utftext += String.fromCharCode((c & 63) | 128);
        } else {
            utftext += String.fromCharCode((c >> 12) | 224);
            utftext += String.fromCharCode(((c >> 6) & 63) | 128);
            utftext += String.fromCharCode((c & 63) | 128);
        }
    }

    return utftext;
}

// 替代原来的 et 函数
var et = function(input) {
    return md5(input);
};

function en(e, t) {
    var n = function(e) {
        e = e.replace(/\r\n/g, "\n");
        for (var t = "", n = 0; n < e.length; n++) {
            var r = e.charCodeAt(n);
            r < 128 ? t += String.fromCharCode(r) : (r > 127 && r < 2048 ? t += String.fromCharCode(r >> 6 | 192) : (t += String.fromCharCode(r >> 12 | 224),
            t += String.fromCharCode(r >> 6 & 63 | 128)),
            t += String.fromCharCode(63 & r | 128))
        }
        return t
    }
    , r = "A4NjFqYu5wPHsO0XTdDgMa2r1ZQocVte9UJBvk6/7=yRnhISGKblCWi+LpfE8xzm3"
    , i = function(e) {
        var t, i, o, a, s, l, c, u = "", d = 0;
        for (e = n(e); d < e.length; )
            t = e.charCodeAt(d++),
            i = e.charCodeAt(d++),
            o = e.charCodeAt(d++),
            a = t >> 2,
            s = (3 & t) << 4 | i >> 4,
            l = (15 & i) << 2 | o >> 6,
            c = 63 & o,
            isNaN(i) ? l = c = 64 : isNaN(o) && (c = 64),
            u = u + r.charAt(a) + r.charAt(s) + r.charAt(l) + r.charAt(c);
        return u
    }
    , o = "test"  // 直接固定为 "test"，不再检测环境
    , a = new Date().getTime();

    const pp = [a, o, e, "[object Object]" === Object.prototype.toString.call(t) || "[object Array]" === Object.prototype.toString.call(t) ? JSON.stringify(t) : ""].join("");
    return {
        "X-s": i(et(pp)),
        "X-t": a
    };
}

function get_xhs_headers(api, time) {
    return en(api, time)
}
"""

x_t_value = str(int(time.time() * 1000))
def return_headers(account_id=None):
    return {
        "accept": "application/json, text/plain, */*",
        "accept-language": "zh-CN,zh;q=0.9",
        "priority": "u=1, i",
        "referer": f"https://ad.xiaohongshu.com/aurora/ad/manage/campaign?vSellerId={account_id}",
        "sec-ch-ua": "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"138\", \"Google Chrome\";v=\"138\"",
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": "\"Windows\"",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
        "v-seller-id": f'{account_id}',
        "x-b3-traceid": "673e1bbb00aa88a9",
        "x-s": "1gOB12O6Zg1lZgOv0j1l0gU6121+sY5l1lMl0YOB0gA3",
        "x-s-common": "2UQAPsHC+aIjqArjwjHjNsQhPsHCH0rjNsQhPaHCH0c1PahFHjIj2eHjwjQgynEDJ74AHjIj2ePjwjQY4gQ6qfrTq9YSJBIjNsQh+sHCH0H1Pshl+AWjNsQh+aHCH0rE+0mSPfb08nGF8gGIP0mY8BQlGf4h8B+IqAWhqBYj4nTCGnQ1Gnkf+/ZIPeZU+AHUweZjNsQh+jHCHjHVHdW7H0ijHjIj2eWjwjQQPAYUaBzdq9k6qB4Q4fpA8b878FSet9RQzLlTcSiM8/+n4MYP8F8LagY/P9Ql4FpUzfpS2BcI8nT1GFbC/L88JdbFyrSiafp/JDMra7pFLDDAa7+8J7QgabmFz7Qjp0mcwp4fanD68p40+fp8qgzELLbILrDA+9p3JpH9LLI3+LSk+d+DJfpSL98lnLYl49IUqgcMc0mrcDShtMmozBD6qM8FyFSh8o+h4g4U+ob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Ea/8QyLchqeDM8Lzl4r8yLoztGSSB/Dh7y/+QynTMGp87nDS38oP9Jbzha/+zzMkc49zQypSE47bF8Sml4bmQzgpkag8jcFSeJLS6qg4aanS0aFSb4d+npdq6/MSa8LS9aLTQc9RA8eSmq7YM4F+Q4DL7anTl8rlQpA8Q4fVlqSkMPFS9cg+DGDESpM87wrSi+nphpdzdanYP2DSe8o+k4gqAaL+jLSkc4M+QcApSpfMHGg+l4r8z4gzUaLPI8p+l4BEQz/pAngQL8rSba7+8+FkAP7bF/DYxJ7+r4g4wG0D6qA8l4BpQ2sRAynF98gYM4oSQ4dQxanS8cDQM49bSJb+6a/P98/8M4FRAG/4S2oiFnomc4oDjNsQhwaHCN/H7PAc7w/WAwaIj2erIH0iINsQhP/rjwjQVygzSHdF=",
        "x-t": "1753670671793",
        'connection': 'close'
    }

def return_content_type_post_headers(account_id=None):
    return {
        "accept": "application/json, text/plain, */*",
        "accept-language": "zh-CN,zh;q=0.9",
        "content-type": "application/json",
        "origin": "https://ad.xiaohongshu.com",
        "priority": "u=1, i",
        "referer": f"https://ad.xiaohongshu.com/aurora/ad/manage/campaign?vSellerId={account_id}",
        "sec-ch-ua": "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"138\", \"Google Chrome\";v=\"138\"",
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": "\"Windows\"",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
        "v-seller-id": f"{account_id}",
        "x-b3-traceid": "00f8a7cdac3b66db",
        "x-s": "1gOB12O6Zg1lZgOv0j1l0gU6121+sY5l1lMl0YOB0gA3",
        "x-s-common": "2UQAPsHC+aIjqArjwjHjNsQhPsHCH0rjNsQhPaHCH0c1PahFHjIj2eHjwjQgynEDJ74AHjIj2ePjwjQY4gQ6q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2e+APgp74LksngbQyrD3a/PMqM8P+fp3JDkS8BMN8nkl4MpQzpQ8anYUPB+M4MmQP7QkanTO8nD6y9Edqe8S2op7+DShpSHhpd4oJnu68/PI4d+3qgz9a7pF4DSkzfpQ4fTa/dpFpBRc4FbQyLEApfMt8nTn4AzPqgzFanWh2nQM4bSQy7bFq7+n/rSk87+g8A+APBG78pzl474zLozHanSQJDSh87+fqgzfanYN8p+jL/4QcMQ1qdk/+rS9L0YQz/+SPpm7L9Ec4eQFLozka/+PprSb/d+hqAmSpop7LfEjpSzQ4Sm1aSmFpnpc4oQQPF4na/PFaDSkn/pQz/8SpoQtqMzrqbQOLoqFanYnzDln4URsLo4panY98/+14p+QyL4GqBc68n8c4ob6LocFJnly4MkDn04Qypbh2S87LrSkcgPAndiUagYbNMkc478Qy9Qc/7pF+7Ql4rRQ4dpnagGhpFSewozUpdqEanTHJLSe4d+/qgq9GfMjPLSizAzQ4jRAy9G7q7YM4FpQ4SrAaLpBqf48Lb8Q4fH92jRB+rSe/7+nJDESPop7arSiP7+hqgchanYQ+rS989prqg4Uag8j87Ql4FpQcURSPMSlJURn4ebOLozCaLPI8n8l4FRQyBpAngQjyDSe+7+hLApAnp8F/o4mPBpgqgq6Jp4DqAbM4oQQP9zAprDM8gYM4rlQzgbLanSVJg+c4A+wG7m7a/P98n8n47SAn04SypkVPoQl4rRQ2BMSagYdq98Vt9pQPFESzopFzDSeqSmQyrbSpfQz4DSbqnRQyLIUaBQgOaHVHdWEH0ilw/HlP/cI+Aq9NsQhP/Zjw0ZVHdWlPaHCHflk4BLjKc==",
        "x-t": "1753670671793",
        'connection': 'close'
    }

mock_click_js = """
function triggerFullClick(element) {
  // 1. 触发鼠标按下
  element.dispatchEvent(new MouseEvent('mousedown', {
    bubbles: true,
    cancelable: true,
    view: window
  }));

  // 2. 触发获取焦点
  element.focus();
  element.dispatchEvent(new Event('focus', {bubbles: true}));

  // 3. 触发鼠标释放
  element.dispatchEvent(new MouseEvent('mouseup', {
    bubbles: true,
    view: window
  }));

  // 4. 触发最终点击
  element.dispatchEvent(new MouseEvent('click', {
    bubbles: true,
    view: window
  }));
}

// 执行函数
triggerFullClick(this);
"""
# 设置显示所有列（默认只显示部分列）
pd.set_option('display.max_columns', None)

# 设置显示所有行（默认只显示部分行）
pd.set_option('display.max_rows', None)

# 设置列宽（防止内容被截断）
pd.set_option('display.max_colwidth', 100)  # 设置每列最大显示宽度

def get_complete_sheet1(file_path=None):
    """
    读取直达链接预先录入sheet，若不存在返回空DataFrame
    """
    try:
        df = pd.read_excel(file_path)
        return df
    except ValueError as e:
        if "Worksheet named '直达链接预先录入' not found" in str(e):
            print(f"警告: 文件 {file_path} 中不存在[直达链接预先录入]sheet")
            return pd.DataFrame()  # 返回空DF
        else:
            raise
    except Exception as e:
        print(f"读取文件失败: {e}")
        return pd.DataFrame()

